<template>
    <div>
        <el-result icon="warning" title="404提示" sub-title="你找的页面走丢了~">
            <template #extra>
                <el-button type="primary" @click="goBack">回到首页</el-button>
            </template>
        </el-result>
    </div>
</template>

<script setup>
import { useRouter } from 'vue-router';

const router = useRouter();

function goBack() {
  // 使用 router.push 进行页面跳转
  router.push('/'); // 或者 router.push('/some-path');
}

</script>